<template>
  <md-field-item id="search-item" @click="onSelect">
    <div class="column">
      <div class="row centered">
        <div style="font-size:26px;line-height:36px;">{{info.stationName}}</div>
        <div v-if="info.tuijian" class="tag">推荐</div>
      </div>
      <div class="detail-text text-ellipsis">{{info.position}}</div>
    </div>
    <md-icon class="position-icon" name="position" slot="left" v-if="type=='search'"></md-icon>
    <md-icon class="position-icon" name="time" slot="left" v-if="type=='history'"></md-icon>
  </md-field-item>
</template>

<script>
import '@/assets/svgs/position.svg';
import '@/assets/svgs/time.svg';
import { Icon, FieldItem } from 'mand-mobile';
export default {
  name: 'search-item',
  components: {
    [Icon.name]: Icon,
    [FieldItem.name]: FieldItem
  },
  data() {
    return {
      tagStr: ''
    };
  },
  props: {
    info: {
      type: Object,
      default: () => {
        return {};
      }
    },
    type: {
      type: String,
      default: 'search'
    }
  },
  methods: {
    onSelect() {
      this.$emit('select', this.info);
    }
  }
};
</script>

<style lang="stylus">
#search-item {
  background-color: #fff;
  height: 112px;
  width: 100vw;

  .position-icon {
    width: 24px;
    height: 30px;
  }

  .md-field-item-content {
    margin: 0px;
  }

  .detail-text {
    font-size: 22px;
    line-height: 32px;
    color: #999999;
    max-width: 600px;
  }

  .tag {
    background-color: #3F88EB;
    width: 52px;
    height: 28px;
    color: #fff;
    font-size: 20px;
    margin-left: 10px;
    text-align: center;
    border-radius: 4px;
    padding: 0px 6px;
    vertical-align: middle;
  }
}
</style>
